package com.logistics.service.impl;

import com.logistics.mapper.AdminMapper;
import com.logistics.pojo.Admin;
import com.logistics.service.AdminService;
import com.logistics.utils.Md5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;

    //根据用户名查询用户
    @Override
    public Admin findByAdminName(String adminname) {
        Admin u = adminMapper.findByAdminName(adminname);
        return u;
    }
    //注册
    @Override
    public void register(String adminname, String password) {

        //密码加密
        String md5String = Md5Util.getMD5String(password);
        //添加用户
        adminMapper.add(adminname, md5String);

    }


}
